//
//  YXForgetPasswordView.m
//  跑跑快销
//
//  Created by 杨潇 on 14-4-28.
//  Copyright (c) 2014年 ylife. All rights reserved.
//

#import "YXForgetPasswordView.h"

@implementation YXForgetPasswordView
@synthesize numberText,authcodeText,inputPasswordText,affirmPasswordText,getAuthcodeBtn,resetPasswordBtn,backgroundScrollVi;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        self.backgroundColor = [UIColor grayColor];
        [self createUI];
    }
    return self;
}

#pragma mark - CreateUI
- (void)createUI
{
    int backgroundScrollViy;
    if (ISDEVICE7) {
        backgroundScrollViy = 64;
    }else{
        backgroundScrollViy = 44;
    }
    backgroundScrollVi = [[UIScrollView alloc] initWithFrame:CGRectMake(0, backgroundScrollViy, 320, [UIScreen mainScreen].bounds.size.height - backgroundScrollViy)];
    backgroundScrollVi.backgroundColor = [UIColor clearColor];
    [self addSubview:backgroundScrollVi];
    
    int titleLabelH = 40;
    UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, titleLabelH)];
    titleLabel.font = [UIFont systemFontOfSize:14];
    titleLabel.text = @"通过注册时候绑定的手机，获取验证码后可以重置密码";
    titleLabel.textColor = [UIColor brownColor];
    titleLabel.textAlignment = NSTextAlignmentLeft;
    titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
    titleLabel.numberOfLines = 0;
    [backgroundScrollVi addSubview:titleLabel];
    
    int textH = 40;
    numberText = [[UITextField alloc] initWithFrame:CGRectMake(10, titleLabel.frame.origin.y + titleLabelH + 10, 300, textH)];
    numberText.keyboardType = UIKeyboardTypeNumberPad;
    numberText.borderStyle = UITextBorderStyleRoundedRect;
    numberText.placeholder = @"输入手机号码";
    [backgroundScrollVi addSubview:numberText];
    
    authcodeText = [[UITextField alloc] initWithFrame:CGRectMake(10, numberText.frame.origin.y + textH + 10, 145, textH)];
    authcodeText.borderStyle = UITextBorderStyleRoundedRect;
    authcodeText.keyboardType = UIKeyboardTypeAlphabet;
    authcodeText.placeholder = @"输入短信验证码";
    [backgroundScrollVi addSubview:authcodeText];
    
    getAuthcodeBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    getAuthcodeBtn.backgroundColor = [UIColor redColor];
    [getAuthcodeBtn setTitle:@"获取验证码" forState:UIControlStateNormal];
    getAuthcodeBtn.frame = CGRectMake(165, authcodeText.frame.origin.y, 145, textH);
    [backgroundScrollVi addSubview:getAuthcodeBtn];
    
    inputPasswordText = [[UITextField alloc] initWithFrame:CGRectMake(10, authcodeText.frame.origin.y + textH + 20, 300, textH)];
    inputPasswordText.secureTextEntry = YES;
    inputPasswordText.font = [UIFont systemFontOfSize:15];
    inputPasswordText.borderStyle = UITextBorderStyleRoundedRect;
    inputPasswordText.placeholder = @"输入密码";
    inputPasswordText.keyboardType = UIKeyboardTypeAlphabet;
    [backgroundScrollVi addSubview:inputPasswordText];
    
    affirmPasswordText = [[UITextField alloc] initWithFrame:CGRectMake(10, inputPasswordText.frame.origin.y + textH + 10, 300, textH)];
    affirmPasswordText.secureTextEntry = YES;
    affirmPasswordText.font = [UIFont systemFontOfSize:15];
    affirmPasswordText.borderStyle = UITextBorderStyleRoundedRect;
    affirmPasswordText.placeholder = @"输入密码";
    affirmPasswordText.keyboardType = UIKeyboardTypeAlphabet;
    [backgroundScrollVi addSubview:affirmPasswordText];
    
    resetPasswordBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    resetPasswordBtn.backgroundColor = [UIColor redColor];
    [resetPasswordBtn setTitle:@"重置密码" forState:UIControlStateNormal];
    resetPasswordBtn.frame = CGRectMake(10, affirmPasswordText.frame.origin.y + textH + 20, 300, textH);
    [backgroundScrollVi addSubview:resetPasswordBtn];
    
    backgroundScrollVi.contentSize = CGSizeMake(320, resetPasswordBtn.frame.size.height + resetPasswordBtn.frame.origin.y + 10);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
